package com.argsstack;

import java.util.HashMap;
import java.util.Map;

public class Arg {

    private Object value;
    private final Map<String, Object> attributes = new HashMap<String, Object>();

    public Arg(Object value) {
        this.value = value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public Object getValue() {
        return value;
    }

    public Arg putAttribute(String attribute, Object value) {
        attributes.put(attribute, value);
        return this;
    }

    public Object getAttribute(String attribute) {
        return attributes.get(attribute);
    }

    public boolean containsAttribute(String attribute) {
        return attributes.get(attribute) != null;
    }
}
